package com.farmcode.console.api.model;

import com.farmcode.base.web.RowSelectedSpc;

import java.io.Serializable;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Table;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.ManyToOne;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import java.util.List;

@Entity
@Table(name="FC_MATCH")
public class Match extends RowSelectedSpc implements Serializable {
	//Fields
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	@Column(name="ID", unique=true, nullable=false, precision=18, scale=0)
	private Long id;
	@ManyToOne
	@JoinColumn(name="PROJECT_ID", nullable=false)
	private Project project;
	@ManyToOne
	@JoinColumn(name="TEMPLATE_ID", nullable=false)
        private Template template;
	@Column(name="NAME", unique=false, nullable=false, precision=20, scale=0)
	private String name;
	@Column(name="PREFIX", unique=false, nullable=false, precision=8, scale=0)
	private String prefix;
	@Column(name="RELOCATE", unique=false, nullable=false, precision=5, scale=0)
	private String relocate;
	@Column(name="RELOCATE_PATH", unique=false, nullable=true, precision=200, scale=0)
	private String relocatePath;
	@Column(name="REPLACE_FOR", unique=false, nullable=true, precision=20, scale=0)
	private String replaceFor;
	@Column(name="ACTIVE", unique=false, nullable=false, precision=1, scale=0)
	private String active;
	@OneToMany(mappedBy="match")
	private List<MatchContext> matchContextCollection;
	
	//Default Constructor
	public Match() {}
	//Constructor, Parameters
	public Match(Long id, String name, String prefix, String relocate, String relocatePath, String replaceFor, String active){
		this.id = id;
		this.name = name;
		this.prefix = prefix;
		this.relocate = relocate;
		this.relocatePath = relocatePath;
		this.replaceFor = replaceFor;
		this.active = active;
	}
	//Getters and Setters
	public void setId(Long id){
		this.id = id;
	}
	public Long getId(){
		return this.id;
	}
	public void setTemplate(Template template){
		this.template = template;
	}
	public Template getTemplate(){
		return this.template;
	}
	public void setProject(Project project){
		this.project = project;
	}
	public Project getProject(){
		return this.project;
	}
	public void setName(String name){
		this.name = name;
	}
	public String getName(){
		return this.name;
	}
	public void setPrefix(String prefix){
		this.prefix = prefix;
	}
	public String getPrefix(){
		return this.prefix;
	}
	public void setRelocate(String relocate){
		this.relocate = relocate;
	}
	public String getRelocate(){
		return this.relocate;
	}
	public void setRelocatePath(String relocatePath){
		this.relocatePath = relocatePath;
	}
	public String getRelocatePath(){
		return this.relocatePath;
	}
	public void setReplace(String replace){
		this.replaceFor = replace;
	}
	public String getReplace(){
		return this.replaceFor;
	}
	public void setActive(String active){
		this.active = active;
	}
	public String getActive(){
		return this.active;
	}
	public List<MatchContext> getMatchContextCollection(){
		return this.matchContextCollection;
	}
	public void setMatchContextCollection(List<MatchContext> matchContextCollection){
		this.matchContextCollection = matchContextCollection;
	}
	@Override
	public String toString(){
		return super.toString();
	}
	
	
}
